﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Maticsoft.Common;

namespace Golf.WebUI.AdminShow.OrderManagement
{
    public partial class Golf_LogisticsStateAdd : Golf.WebUI.App_code.ValidateLogin
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSave_Click(object sender, EventArgs e)
        {

            string strErr = "";
            if (this.txtLogisticsStateName.Text.Trim().Length == 0)
            {
                strErr += "物流状态名称 1 开始配货 2不能为空！\\n";
            }
            if (!PageValidate.IsNumber(txtAdminId.Text))
            {
                strErr += "处理人id	Golf_Admi格式错误！\\n";
            }
            if (!PageValidate.IsDateTime(txtAddTime.Text))
            {
                strErr += "处理时间格式错误！\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string LogisticsStateName = this.txtLogisticsStateName.Text;
            int AdminId = int.Parse(this.txtAdminId.Text);
            DateTime AddTime = DateTime.Parse(this.txtAddTime.Text);

            Golf.Model.Golf_LogisticsState model = new Golf.Model.Golf_LogisticsState();
            model.LogisticsStateName = LogisticsStateName;
            model.AdminId = AdminId;
            model.AddTime = AddTime;

            Golf.BLL.Golf_LogisticsState bll = new Golf.BLL.Golf_LogisticsState();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功！", "add.aspx");

        }


        public void btnCancle_Click(object sender, EventArgs e)
        {
            Response.Redirect("list.aspx");
        }
    }
}